(bug 17045) Prefill the block form with the options of the existing block when modify...
authorAlex Z <mrzman@users.mediawiki.org>
Sun, 18 Jan 2009 02:57:54 +0000 (02:57 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Sun, 18 Jan 2009 02:57:54 +0000 (02:57 +0000)
RELEASE-NOTES
includes/specials/SpecialBlockip.php

index 456e9b8..98cb48c 100644 (file)
@@ -39,6 +39,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   of Service page, for example
 * Add new hook 'UserLoadFromDatabase' that is called while loading a user
   from the database.
+* (bug 17045) Options on the block form are prefilled with the options of the 
+  existing block when modifying an existing block.
 
 === Bug fixes in 1.15 ===
 * (bug 16968) Special:Upload no longer throws useless warnings.
index c7e7c54..3c305ad 100644 (file)
@@ -106,6 +106,15 @@ class IPBlockForm {
                                ( $currentBlock->mAddress == $this->BlockAddress ) ) ) {
                                        $wgOut->addWikiMsg( 'ipb-needreblock', $this->BlockAddress );
                                        $alreadyBlocked = true;
+                                       # Set the block form settings to the existing block
+                                       $this->BlockAnonOnly = $currentBlock->mAnonOnly;
+                                       $this->BlockCreateAccount = $currentBlock->mCreateAccount;
+                                       $this->BlockEnableAutoblock = $currentBlock->mEnableAutoblock;
+                                       $this->BlockEmail = $currentBlock->mBlockEmail;
+                                       $this->BlockHideName = $currentBlock->mHideName;
+                                       $this->BlockAllowUsertalk = $currentBlock->mAllowUsertalk;
+                                       $this->BlockOther = wfTimestamp( TS_RFC2822, $currentBlock->mExpiry );
+                                       $this->BlockReason = $currentBlock->mReason;
                        }
                }